<template>
	<view class="body">
		<view class="tops">
			<view class="shop">
				<image :src="shop_info.category_image" mode="aspectFill" class="Boutique"></image>
				<view class="title">
					{{shop_info.shop_name}}
				</view>
				<view class="right" @click="toggle">
					<view class="size">
						切换
					</view>
					<image :src="$IMG_URL('/static/home/indicate.png')" mode="aspectFill" class="icon"></image>
				</view>
			</view>
			<headerTwo></headerTwo>
			<view class="search">
				<u-search placeholder="搜索会员姓名、手机号" :show-action="false" shape="square"></u-search>
			</view>
		</view>
		<scroll-view scroll-y="true" class="scrollView">
			<view class="comlumn_box">
				<view v-for="(item,index) in list" :key="index" class="Item" @click.stop="$ROUTELINK('/pageC/coach/member/physicalDeati')">
					<view class="header">
						<view class="left">
							{{item.time}}
						</view>
						<view class="right">
							James
						</view>
					</view>
					<view class="foot">
						<view class="top_box">
							<view class="name mr">
								张心心
							</view>
							<view class="size mr">
								男
							</view>
							<view class="size flex">
								23岁
							</view>
							<view class="size">
								18856781234
							</view>
						</view>
						<view class="bottom_box">
							<view class="childItem">
								<view class="top">
									<view class="title">
										体重
									</view>
									<view class="title2">
										kg
									</view>
								</view>
								<view class="bottom">
									75.5
								</view>
							</view>
							<view class="childItem">
								<view class="top">
									<view class="title">
										身高
									</view>
									<view class="title2">
										cm
									</view>
								</view>
								<view class="bottom">
									181
								</view>
							</view>
							<view class="childItem">
								<view class="top">
									<view class="title">
										BMI
									</view>
								</view>
								<view class="bottom">
									<text>23.0</text>
									<view class="tag">
										标准
									</view>
								</view>
							</view>
							<view class="childItem">
								<view class="top">
									<view class="title">
										体脂率
									</view>
									<view class="title2">
										%
									</view>
								</view>
								<view class="bottom">
									<text>23.0</text>
									<view class="tag">
										标准
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
		<view class="foot_box">
			<view class="btn" @click.stop="$ROUTELINK('addPhysical')">
				添加体测记录
			</view>
		</view>
		<FieldPopupVue :popupShow="popupShow" :FieldList="Field" @sure="sure" @changeActiveIndex="changeActiveIndex"
			:activeIndex="FieldIndex"></FieldPopupVue>
	</view>
</template>

<script>
	import {
		atShop
	} from '@/api/manager.js'
	import headerTwo from '../coach/components/header2.vue'
	import FieldPopupVue from '../../pages/user/components/Field-popup.vue'
	export default {
		components: {
			headerTwo,
			FieldPopupVue,
		},
		data(){
			return{
				coachShow:true,
				FieldIndex: -1,
				shopName: '',
				popupShow: false,
				shop_info: {},
				list:[
					{
						time:'2024-09-24 14:15:15',
						name:'James',
						tizhong:'75.5',
						shengao:'181',
						BMI:'23.0',
						tizhi:'20.5'
					},{
						time:'2024-09-24 14:15:15',
						name:'James',
						tizhong:'75.5',
						shengao:'181',
						BMI:'23.0',
						tizhi:'20.5'
					},
					{
						time:'2024-09-24 14:15:15',
						name:'James',
						tizhong:'75.5',
						shengao:'181',
						BMI:'23.0',
						tizhi:'20.5'
					}
				]
			}
		},
		onLoad() {
			this.getatShop()
		},
		methods:{
			sure() {
				this.popupShow = false
			},
			changeActiveIndex(item, index) {
				this.FieldIndex = index
				this.getatShop({
					shop_id: item.shop_id
				})
			},
			toggle() {
				console.log(11);
				this.popupShow = true
			},
			getatShop(e) {
				atShop(e).then(({
					data: res
				}) => {
					console.log('res', res);
					if (res.code == 1) {
						this.shop_info = res.data
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #e9e9e9;
	
	}
	.body{
		display: flex;
		flex-direction: column;
		align-items: center;
		.tops{
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 750rpx;
			padding: 24rpx 0;
			background: #ffffff;
			.shop {
				width: 100%;
				display: flex;
				flex-direction: row;
				align-items: center;
				margin-bottom: 22rpx;
				padding: 0 23rpx;
			
				.Boutique {
					width: 114rpx;
					height: 36rpx;
					margin-right: 12rpx;
				}
			
				.title {
					flex: 1;
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC-Bold;
					font-weight: 700;
					text-align: left;
					color: #333333;
				}
			
				.right {
					display: flex;
					flex-direction: row;
					align-items: center;
			
					.size {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						color: #666666;
						margin-right: 8rpx;
					}
			
					.icon {
						width: 10rpx;
						height: 16rpx;
					}
				}
			}
			.search{
				margin-top: 24rpx;
				width: 702rpx;
				height: 66rpx;
				background: #f6f6f6;
				border-radius: 16rpx;
			}
		}
		.scrollView{
			height: 71vh;
			.comlumn_box{
				display: flex;
				flex-direction: column;
				align-items: center;
				padding-top: 20rpx;
				.Item{
					width: 702rpx;
					background: #73F0EA;
					border-radius: 32rpx;
					display: flex;
					flex-direction: column;
					align-items: center;
					margin-bottom: 20rpx;
					.header{
						width: 100%;
						height: 104rpx;
						padding: 0 16rpx;
						display: flex;
						flex-direction: row;
						align-items: center;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC-Bold;
						font-weight: 700;
						text-align: left;
						color: #ffffff;
						.left{
							flex: 1;
						}
						.right{
							
						}
					}
					.foot{
						width: 702rpx;
						height: 244rpx;
						background: linear-gradient(180deg,#e1f3f1, #ffffff);
						border:1rpx solid #73F0EA;
						border-radius: 32rpx;
						padding: 24rpx 32rpx 32rpx;
						.top_box{
							display: flex;
							flex-direction: row;
							align-items: center;
							border-bottom: 1rpx solid #e9e9e9;
							padding-bottom: 22rpx;
							.name{
								font-size: 28rpx;
								font-family: PingFang SC, PingFang SC-Bold;
								font-weight: 700;
								text-align: left;
								color: #000000;
							}
							.mr{
								margin-right: 32rpx;
							}
							.flex{
								flex: 1;
							}
							.size{
								font-size: 28rpx;
								font-family: PingFang SC, PingFang SC-Medium;
								font-weight: 500;
								text-align: left;
								color: #666666;
							}
						}
						.bottom_box{
							width: 100%;
							padding-top: 38rpx;
							display: flex;
							flex-direction: row;
							align-items: center;
							justify-content: space-between;
							.childItem{
								display: flex;
								flex-direction: column;
								.top{
									display: flex;
									flex-direction: row;
									align-items: baseline;
									margin-bottom: 4rpx;
									.title{
										font-size: 28rpx;
										font-family: PingFang SC, PingFang SC-Bold;
										font-weight: 700;
										text-align: left;
										color: #666666;
										margin-right: 8rpx;
									}
									.title2{
										font-size: 24rpx;
										font-family: PingFang SC, PingFang SC-Medium;
										font-weight: 500;
										text-align: left;
										color: #b6b6b6;
									}
								}
								.bottom{
									display: flex;
									flex-direction: row;
									align-items: center;
									font-size: 40rpx;
									font-family: DIN, DIN-Bold;
									font-weight: 700;
									text-align: left;
									color: #333333;
									.tag{
										margin-left: 8rpx;
										width: 48rpx;
										height: 28rpx;
										background: #47cc88;
										border: 2rpx solid rgba(0,0,0,0.00);
										border-radius: 8rpx;
										font-size: 20rpx;
										font-family: PingFang SC, PingFang SC-Bold;
										font-weight: 700;
										text-align: left;
										color: #ffffff;
										display: flex;
										align-items: center;
										justify-content: center;
									}
								}
							}
						}
					}
				}
			}
		}
		.foot_box{
			position: fixed;
			bottom: 0;
			width: 750rpx;
			height: 160rpx;
			background: #ffffff;
			box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(166,179,194,0.30); 
			display: flex;
			justify-content: center;
			padding-top: 10rpx;
			.btn{
				width: 710rpx;
				height: 88rpx;
				background: #73F0EA;
				border-radius: 16rpx;
				font-size: 34rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: center;
				color: #ffffff;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
	}
</style>